package com.hygj.service.impl;


import com.hygj.baseUtil.BaseDao;
import com.hygj.baseUtil.BaseServiceImpl;
import com.hygj.pojo.File;
import com.hygj.service.FileService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author hygl
 */
@Service
public class FileServiceImpl extends BaseServiceImpl<File> implements FileService {

	@Resource(name = "fileDao")
	@Override
	public void setDao(BaseDao<File> dao) {
		super.setDao(dao);
	}

	@Override
	public void delete(Integer[] ids) {
		Map<String, Object> params = new HashMap<String, Object>();
		if(ids.length > 0){
			for(Integer file_id: ids){
				//给userMapper 传id值  通过 params
				params.put("file_id", file_id);
				delete("delete",file_id);

			}

		}

	}

	@Override
	public List<File> selectFile(Integer file_id) {
	   Map<String, Object> params = new HashMap<String, Object>();
		params.put("file_id", file_id);
		return (List<File>) find("find",params);
	}


}
